Page({
  data: {
    nickName: "",
    avatarUrl: "",
    gender: "",
    province: "",
    city: "",
    country: ""
  },

  showUserInfoTap: function () {
    var that = this;
    wx.getUserInfo({
      success: function (res) {
        console.log(res);

        var userInfo = res.userInfo
        console.log(userInfo);
        var nickName = userInfo.nickName
        var avatarUrl = userInfo.avatarUrl
        var gender = userInfo.gender  //性别 0：未知、1：男、2：女
        var city = userInfo.city
        var country = userInfo.country
        if (gender == 1) {
          gender = '男'
        } else if (gender == 2) {
          gender = '女'
        } else {
          gender = '未知'
        }
        that.setData({
          nickName: nickName,
          avatarUrl: avatarUrl,
          gender: gender,
          country: country,
          jifen: 500
        })
      }
    })
  },
  data: {
    imgUrls: [
 'https://www.lancome.com.cn/build/images/member/member-gift1.jpg',
 'https://www.lancome.com.cn/build/images/member/member-gift2.jpg?_',
 'https://www.lancome.com.cn/build/images/member/member-gift3.jpg?_',
 ],
    swiperIndex: 0 //这里不写第一次启动展示的时候会有问题
 },
 
bindchange(e) {
 this.setData({
      swiperIndex: e.detail.current
 })
 },
  
 
})
